<template>
	<view class="box">
		<view class="">
			<goodsCard v-for="(item,i) in list" :key="i" :date='item'></goodsCard>
		</view>
	</view>
</template>

<script>
	import goodsCard from './components/goods_card2.vue'
	import {
		mapMutations,
		mapActions,
		mapState,
		mapGetters
	} from 'vuex';
	export default {
		components: {
			goodsCard
		},
		data() {
			return {
				list: []
			}
		},
		mounted() {
			this.aliLogin()
			this.getlist()
		},
		methods: {
			...mapActions(['getUserInfo', 'showAuthModal']),
			getlist() {
				this.$http('other.recommend', {}).then(res => {
					console.log(res);
					if (res.code == 1) {
						this.list = res.data.list
					}
				})
			},
			// 支付宝登录
			aliLogin() {
				my.getAuthCode({
					scopes: 'auth_user',
					success: (res) => {
						console.log(res);
						this.$http('common.aliLogins', {
							code: res.authCode
						}).then(res => {
							console.log(res);
							if (res.code == 1) {
								// this.closeAuthModal()
								this.getUserInfo(res.data.user.token)
								this.$http('user.bindpid', {
									pid: '141'
								}).then(res => {
									
								})


							}
						})

					},
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		min-height: 100vh;
		padding: 26rpx;
		box-sizing: border-box;
	}
</style>
